<?php
$title = "管理首页";
include 'header.php';
try {
    $slcount=count($pdo->query("SELECT * FROM 9g_msg")->fetchAll());
    $dclcount=count($pdo->query("SELECT * FROM 9g_msg WHERE `status`='0'")->fetchAll());
    $typecount=count($pdo->query("SELECT * FROM 9g_type")->fetchAll());
    $usercount=count($pdo->query("SELECT * FROM 9g_user")->fetchAll());
    $aouncecount=count($pdo->query("SELECT * FROM 9g_aounce")->fetchAll());
}catch (Exception $e){

}
$pdo=null;
?>
<div class="main-content">
    <div class="page-content">
        <div class="container-fluid">
            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                        <h4 class="mb-sm-0">管理主页</h4>
                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="javascript: void(0);">管理主页</a></li>
                            </ol>
                        </div>
                    </div>
                </div>
            </div><!-- end page title -->
            <div class="row">
                <div class="col-xl-3 col-sm-6">
                    <div class="card">
                        <div class="card-body">
                            <div class="d-flex text-muted">
                                <div class="flex-shrink-0  me-3 align-self-center">
                                    <div class="avatar-sm">
                                        <div class="avatar-title bg-light rounded-circle text-primary font-size-20">
                                            <i class="ri-group-line"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="flex-grow-1 overflow-hidden">
                                    <p class="mb-1">收录总数</p>
                                    <h5 class="mb-3"><?php echo $slcount; ?>个</h5>
                                </div>
                            </div>
                        </div><!-- end card-body -->
                    </div><!-- end card -->
                </div><!-- end col -->
                <div class="col-xl-3 col-sm-6">
                    <div class="card">
                        <div class="card-body">
                            <div class="d-flex text-muted">
                                <div class="flex-shrink-0  me-3 align-self-center">
                                    <div class="avatar-sm">
                                        <div class="avatar-title bg-light rounded-circle text-primary font-size-20">
                                            <i class="ri-group-line"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="flex-grow-1 overflow-hidden">
                                    <p class="mb-1">收录待处理总数</p>
                                    <h5 class="mb-3"><?php echo $dclcount; ?>个</h5>
                                </div>
                            </div>
                        </div><!-- end card-body -->
                    </div><!-- end card -->
                </div><!-- end col -->
                <div class="col-xl-3 col-sm-6">
                    <div class="card">
                        <div class="card-body">
                            <div class="d-flex text-muted">
                                <div class="flex-shrink-0  me-3 align-self-center">
                                    <div class="avatar-sm">
                                        <div class="avatar-title bg-light rounded-circle text-primary font-size-20">
                                            <i class="ri-group-line"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="flex-grow-1 overflow-hidden">
                                    <p class="mb-1">收录已处理总数</p>
                                    <h5 class="mb-3"><?php echo $slcount-$dclcount; ?>个</h5>
                                </div>
                            </div>
                        </div><!-- end card-body -->
                    </div><!-- end card -->
                </div><!-- end col -->
                <div class="col-xl-3 col-sm-6">
                    <div class="card">
                        <div class="card-body">
                            <div class="d-flex text-muted">
                                <div class="flex-shrink-0  me-3 align-self-center">
                                    <div class="avatar-sm">
                                        <div class="avatar-title bg-light rounded-circle text-primary font-size-20">
                                            <i class="ri-group-line"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="flex-grow-1 overflow-hidden">
                                    <p class="mb-1">收录类型</p>
                                    <h5 class="mb-3"><?php echo $typecount;?>个</h5>

                                </div>
                            </div>
                        </div><!-- end card-body -->
                    </div><!-- end card -->
                </div><!-- end col -->
                <div class="col-xl-3 col-sm-6 offset-xl-3">
                    <div class="card">
                        <div class="card-body">
                            <div class="d-flex text-muted">
                                <div class="flex-shrink-0  me-3 align-self-center">
                                    <div class="avatar-sm">
                                        <div class="avatar-title bg-light rounded-circle text-primary font-size-20">
                                            <i class="ri-group-line"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="flex-grow-1 overflow-hidden">
                                    <p class="mb-1">团队人数</p>
                                    <h5 class="mb-3"><?php echo $usercount;?>个</h5>
                                </div>
                            </div>
                        </div><!-- end card-body -->
                    </div><!-- end card -->
                </div><!-- end col -->
                <div class="col-xl-3 col-sm-6">
                    <div class="card">
                        <div class="card-body">
                            <div class="d-flex text-muted">
                                <div class="flex-shrink-0  me-3 align-self-center">
                                    <div class="avatar-sm">
                                        <div class="avatar-title bg-light rounded-circle text-primary font-size-20">
                                            <i class="ri-group-line"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="flex-grow-1 overflow-hidden">
                                    <p class="mb-1">公告总数</p>
                                    <h5 class="mb-3"><?php echo $aouncecount;?>个</h5>
                                </div>
                            </div>
                        </div><!-- end card-body -->
                    </div><!-- end card -->
                </div><!-- end col -->
            </div><!-- end row -->
            <div class="row">
                <div class="col-md-6 offset-md-3">
                    <div class="card">
                        <div class="card-body">
                        <h5 class="card-title">环境及程序基本信息</h5>
                                                <div class="server-load row">
                                                    <div class="server-stat col s6">
                                                        <p><?php echo PHP_VERSION;?></p>
                                                        <span>php版本</span>
                                                    </div>
                                                    <div class="server-stat col s6">
                                                        <p>pro1.1</p>
                                                        <span>程序版本</span>
                                                    </div>
                                                    <div class="server-stat col s6">
                                                        <p>云风轻黑名单系统</p>
                                                        <span>程序名称</span>
                                                    </div>
                                                </div>
                                    <div class="stats-info">
                                        <ul>
                                            <li>当前项目由云风轻(QQ:65288050)独立开发完成，尊重作者开发成果(此作品为早期作品，代码高耦合、低内聚，复用性差，不适宜进行高质量二此开发)，请勿修改版权</li>
                                            <li>本项目之后会进行更新，包括：模板和功能，更新详情请加入QQ群获取更新消息<a target="_blank" href="点击链接加入群聊【云风轻博客||码群-站长交流】：https://qm.qq.com/q/BpH0HMjG1k"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="云风轻博客||码群-站长" title="云风轻博客||码群-站长"></a></li>
                                            <li>个人博客<a href="https://blog.pureyun.com/">点我进入</a></li>
                                            <li>项目开源地址gitee:<a target="_blank" href="https://gitee.com/yunfengqing/hmd">https://gitee.com/yunfengqing/hmd</a></li>
                                            <li><a href="setsys.php" class="btn btn-danger">主页修改</a></li>
                                            <li><a href="../index.php" class="btn btn-info">前往首页</a></li>
                                        </ul>
                                    </div>
                    </div>
                    </div>
                </div>
            </div>
        </div><!-- container-fluid -->
    </div><!-- End Page-content -->
    <footer class="footer">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-6">
                    <script>
                        document.write(new Date().getFullYear())
                    </script>(c) Cloud.
                </div>
                <div class="col-sm-6">
                    <div class="text-sm-end d-none d-sm-block">Crafted with <i class="mdi mdi-heart text-danger"></i>By <a href="https://www.9gyun.cn">云风轻产品授权中心</a></div>
                </div>
            </div>
        </div>
    </footer>
</div><!-- end main content-->
</div><!-- END layout-wrapper -->


<!-- Javascripts -->
<?php include('footer.php'); ?>
</body>

</html>